const
  NMAX = 250;

var
  img: array[1..NMAX + 1] of string;
  down: array[1..NMAX + 1, 1..NMAX + 1] of longint;  
  m, n, i, i1, i2, j, k, count, answer: longint;

begin
  readln(m, n);
  for i := 1 to m do 
    readln(img[i]);

  img[m+1] := '';
  for j := 1 to n do
    img[m + 1] := img[m + 1] + '.';

  for i := 1 to m + 1 do
    down[i][n + 1] := 0;

  count := 0;
  for j := 1 to n do begin
    for i := 1 to m + 1 do
      if img[i][j] = '*' then 
        inc(count)
      else begin
        down[i][j] := 0;
        for k := i - count to i - 1 do
          down[k][j] := i - k;
        count := 0;
      end;
  end;

  answer := 0;
  for i1 := 1 to m - 2 do
    for i2 := i1 + 2 to m do 
    begin
      count := 0;
      for j := 1 to n + 1 do begin
        if (down[i1][j] > 0) and (down[i2][j] > 0) then 
        begin
          if down[i1][j] >= i2 - i1 + 1 then
          begin
            inc(count);
            if j > 1 then
              if down[i1][j - 1] >= i2 - i1 + 1 then
                dec(answer);
          end;
        end
        else
        begin
          answer := answer + count * (count - 1) div 2;
          count := 0;
        end;
      end;
    end;

  writeln(answer);

end.  

